package com.party.business.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.party.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.party.business.mapper.TNdArticleMapper;
import com.party.business.domain.TNdArticle;
import com.party.business.service.ITNdArticleService;

/**
 * 年度动态Service业务层处理
 *
 * @author ruoyi
 * @date 2025-04-24
 */
@Service
public class TNdArticleServiceImpl extends ServiceImpl<TNdArticleMapper,TNdArticle>  implements ITNdArticleService
{
    @Autowired
    private TNdArticleMapper tNdArticleMapper;

    /**
     * 查询年度动态
     *
     * @param id 年度动态主键
     * @return 年度动态
     */
    @Override
    public TNdArticle selectTNdArticleById(String id)
    {
        return tNdArticleMapper.selectTNdArticleById(id);
    }

    /**
     * 查询年度动态列表
     *
     * @param tNdArticle 年度动态
     * @return 年度动态
     */
    @Override
    public List<TNdArticle> selectTNdArticleList(TNdArticle tNdArticle)
    {
        return tNdArticleMapper.selectTNdArticleList(tNdArticle);
    }

    /**
     * 新增年度动态
     *
     * @param tNdArticle 年度动态
     * @return 结果
     */
    @Override
    public int insertTNdArticle(TNdArticle tNdArticle)
    {
                tNdArticle.setCreateTime(DateUtils.getNowDate());
            return tNdArticleMapper.insertTNdArticle(tNdArticle);
    }

    /**
     * 修改年度动态
     *
     * @param tNdArticle 年度动态
     * @return 结果
     */
    @Override
    public int updateTNdArticle(TNdArticle tNdArticle)
    {
                tNdArticle.setUpdateTime(DateUtils.getNowDate());
        return tNdArticleMapper.updateTNdArticle(tNdArticle);
    }

    /**
     * 批量删除年度动态
     *
     * @param ids 需要删除的年度动态主键
     * @return 结果
     */
    @Override
    public int deleteTNdArticleByIds(String[] ids)
    {
        return tNdArticleMapper.deleteTNdArticleByIds(ids);
    }

    /**
     * 删除年度动态信息
     *
     * @param id 年度动态主键
     * @return 结果
     */
    @Override
    public int deleteTNdArticleById(String id)
    {
        return tNdArticleMapper.deleteTNdArticleById(id);
    }
}
